import { ipcRenderer } from "electron";
import { ICreateWs } from "../types/ws.ts";
import { IcreateWindowParams } from "../types/window.ts";

export const UserPreload = {
  // 连接ws 合并数据
  connectWs: (params: ICreateWs) => {
    return ipcRenderer.invoke("connectWs", params);
  },
  login: () => {
    ipcRenderer.send("login");
  },
  // 注册
  register: (params: IcreateWindowParams) => {
    ipcRenderer.send("register", params);
  },
  // 推出登录
  logout: () => {
    ipcRenderer.send("logout");
  },
  // 关闭ws
  closeWs: () => {
    ipcRenderer.send("closeWs");
  },
};
